import {getToken} from "@/util";
import axiosInstance from "@/api";

export async function useCreateGroup(userId: number, name: string, desc: string, cover: string) {
    const token = getToken()
    return await axiosInstance.post<any, { msg: string, code: number, data: any }>("/v1/group/create", {
        leader_id: userId,
        name: name,
        desc: desc,
        cover: cover
    }, {
        headers: {
            "x-token": token
        }
    })
}